{% extends "base.html" %}

{%block title%}Pregled izpitnih rokov{% endblock %}

{% block content %}

{% if not error %}

	{% if step == 0 %}
	
		<p>Izberi parametre prikaza</p>
		<form method="post">
		{% csrf_token %}
		
		{{ viewExams.as_p }}
		
		<input name="step" type="hidden" value="{{step_next}}" />
		<input type="submit" value="Prikaži" />
		</form>
	
	{% else %}
	  {% include "snippets/core/print.htm" %}
	
	  <h2> Pregled izpitnih rokov </h2>
	
		{% if exam_exist %}
		<table class = "list">
			<th>#</th>
			<th> Predmet </th>
			<th> Datum </th>
			<th> Predavatelj </th>
			<th> Maks. št prijav </th>
			<th> Št. prijav </th>
			<th> Predavalnica </th>
			<th> Ura </th>
			
			{% for i in queryset_exam %}
			<tr> 
				<td>{{ forloop.counter }} </td>
				<td>{{ i.subject.subject }}</td>
				<td>{{ i.date }}</td>
				<td>{{ i.show_professor }}</td>
				<td>{{ i.max_students }}</td>
				<td>{{ i.num_students }}</td>
				{% if i.place == None %}
					<td></td>
				{% else %}
					<td>{{ i.place }}</td>	
				{% endif %}	
					
				{% if i.time == default_time or i.time == None %}
					<td> </td>
				{% else %}	
					<td>{{ i.time }}</td>
				{% endif %}	
			</tr>
			
			{% endfor %}
		</table>
		
		{% else %}
		<center>Trenutno ni na voljo nobenega izpita!</center>
		
		{% endif %}
		
	{% endif %}	
{% else %}
<h2><center>Interna napaka!</center>></h2>	
{% endif %}

{% endblock %}>
